#pragma once

#include "device/cpu.h"
#include "nlohmann/json.hpp"

using json = nlohmann::json;

namespace OHOS {
namespace SmartServe {
struct CPUConfig {
    unsigned id;
    unsigned frequency;
    CPUType type;
    std::vector<unsigned> availableFreqs;
};
NLOHMANN_JSON_SERIALIZE_ENUM(CPUType,
                             {
                                 {CPUType::LITTLE, "LITTLE"},
                                 {CPUType::MIDDLE, "MIDDLE"},
                                 {CPUType::BIG, "BIG"},
                             })

NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(CPUConfig, id, frequency, type, availableFreqs)

struct GPUConfig {
    unsigned id;
    unsigned frequency;
    std::vector<unsigned> availableFreqs;
};
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(GPUConfig, id, frequency, availableFreqs)

struct NPUConfig {
    unsigned id;
    unsigned frequency;
    std::vector<unsigned> availableFreqs;
};
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(NPUConfig, id, frequency, availableFreqs)

struct MemoryConfig {
    unsigned id;
    size_t totalSize;
};
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(MemoryConfig, id, totalSize)

struct Config {
    std::vector<CPUConfig> cpus;
    std::vector<GPUConfig> gpus;
    std::vector<NPUConfig> npus;
    MemoryConfig memory;
};
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Config, cpus, gpus, npus, memory)

} // namespace SmartServe
} // namespace OHOS